<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   《Think Python 2e》最新版中文翻译 第一章程序之道  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://dataunion.org/24684.html",
                  host: "http://dataunion.org",
                  prePath: "http://dataunion.org",
                  scheme: "http",
                  pathBase: "http://dataunion.org/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466457425: Accept with keywords: (title(0.2):Python,程序,社区,中文翻译,数盟, topn(0.2):数字,形式语言,引号,数盟,自然语言,语言,示例,Python,指令,数学,计算,文章,类型,译者,歧义,结构,解释器,计算机科学,编程,语法,字符串,语句,运算符,记号,编程语言,标记,浮点数,结果,程序,单词).-->
 </head>
 <body onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    《Think Python 2e》最新版中文翻译 第一章程序之道
   </h1>
  </div>
  <div class="container" id="xmain">
   ﻿﻿
   <title>
    《Think Python 2e》最新版中文翻译 第一章程序之道 | 数盟社区
   </title>
   <!-- All in One SEO Pack 2.2.7.6.2 by Michael Torbert of Semper Fi Web Design[32,79] -->
   <!-- /all in one seo pack -->
   <!--
<div align="center">
<a href="http://strata.oreilly.com.cn/hadoop-big-data-cn?cmp=mp-data-confreg-home-stcn16_dataunion_pc" target="_blank"><img src="http://dataunion.org/wp-content/uploads/2016/05/stratabj.jpg"/ ></a>
</div>
-->
   <header id="header-web">
    <div class="header-main">
     <hgroup class="logo">
      <h1>
       <a href="http://dataunion.org/" rel="home" title="数盟社区">
        <img src="http://dataunion.org/wp-content/themes/yzipi/images/logo.png"/>
       </a>
      </h1>
     </hgroup>
     <!--logo-->
     <nav class="header-nav">
      <ul class="menu" id="menu-%e4%b8%bb%e8%8f%9c%e5%8d%95">
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-71" id="menu-item-71">
        <a href="http://dataunion.org/category/events" title="events">
         活动
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22457" id="menu-item-22457">
          <a href="http://dataunion.org/2016timeline">
           2016档期
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-22459" id="menu-item-22459">
          <a href="http://dataunion.org/category/parterc">
           合作会议
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-20869" id="menu-item-20869">
        <a href="http://dataunion.org/category/tech" title="articles">
         文章
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20867" id="menu-item-20867">
          <a href="http://dataunion.org/category/tech/base" title="base">
           基础架构
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3302" id="menu-item-3302">
          <a href="http://dataunion.org/category/tech/ai" title="ai">
           人工智能
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3303" id="menu-item-3303">
          <a href="http://dataunion.org/category/tech/analysis" title="analysis">
           数据分析
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21920" id="menu-item-21920">
          <a href="http://dataunion.org/category/tech/dm">
           数据挖掘
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3314" id="menu-item-3314">
          <a href="http://dataunion.org/category/tech/viz" title="viz">
           可视化
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3305" id="menu-item-3305">
          <a href="http://dataunion.org/category/tech/devl" title="devl">
           编程语言
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-20876" id="menu-item-20876">
        <a href="http://dataunion.org/category/industry">
         行业
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-16328" id="menu-item-16328">
          <a href="http://dataunion.org/category/industry/case" title="case">
           行业应用
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-2112" id="menu-item-2112">
          <a href="http://dataunion.org/category/industry/demo" title="demo">
           Demo展示
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21562" id="menu-item-21562">
          <a href="http://dataunion.org/category/industry/news">
           行业资讯
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-311" id="menu-item-311">
        <a href="http://dataunion.org/category/sources" title="sources">
         资源
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-20870" id="menu-item-20870">
        <a href="http://dataunion.org/category/books" title="book">
         图书
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21363" id="menu-item-21363">
        <a href="http://dataunion.org/category/training">
         课程
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-21853" id="menu-item-21853">
        <a href="http://dataunion.org/category/jobs">
         职位
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-22050" id="menu-item-22050">
          <a href="http://dataunion.org/category/career">
           职业规划
          </a>
         </li>
        </ul>
       </li>
      </ul>
     </nav>
     <!--header-nav-->
    </div>
   </header>
   <!--header-web-->
   <div id="main">
    <div id="soutab">
     <form action="http://dataunion.org/" class="search" method="get">
     </form>
    </div>
    <div id="container">
     <nav id="mbx">
      当前位置：
      <a href="http://dataunion.org">
       首页
      </a>
      &gt;
      <a href="http://dataunion.org/category/books">
       图书
      </a>
      &gt;  正文
     </nav>
     <!--mbx-->
     <article class="content">
      <header align="centre" class="contenttitle">
       <div class="mscc">
        <h1 class="mscctitle">
         <a href="http://dataunion.org/24684.html">
          《Think Python 2e》最新版中文翻译 第一章程序之道
         </a>
        </h1>
        <address class="msccaddress ">
         <em>
          171 次阅读 -
         </em>
         <a href="http://dataunion.org/category/books" rel="category tag">
          图书
         </a>
        </address>
       </div>
      </header>
      <div class="content-text">
       <p>
        本书的目标是教你像计算机科学家一样思考。这一思考方式集成了数学、工程以及自然科学的一些最好的特点。像数学家一样，计算机科学家使用形式语言表示思想（具体来说是计算）。像工程师一样，计算机科学家设计东西，将零件组成系统，在各种选择之间寻求平衡。像科学家一样，计算机科学家观察复杂系统的行为，形成假设并且对预测进行检验。
       </p>
       <p>
        对于计算机科学家，最重要的技能是
        <strong>
         解决问题的能力
        </strong>
        。解决问题（problem solving）意味着对问题进行形式化，寻求创新型的解决方案，并且清晰、准确地表达解决方案的能力。事实证明，学习编程的过程是锻炼问题解决能力的一个绝佳机会。这就是为什么本章被称为“程序之道”。
       </p>
       <p>
        一方面，你将学习如何编程，这本身就是一个有用的技能。另一方面，你将把编程作为实现自己目的的手段。随着学习的深入，你会更清楚自己的目的。
       </p>
       <div class="section" id="id2">
        <h2>
         什么是程序？
        </h2>
        <p>
         <strong>
          程序
         </strong>
         是一系列说明如何执行计算（computation）的指令。计算可以是数学上的计算，例如寻找公式的解或多项式的根，也可以是一个符号计算（symbolic computation），例如在文档中搜索并替换文本或者图片，就像处理图片或播放视频。
        </p>
        <p>
         不同编程语言中，程序的具体细节也不一样，但是有一些基本的指令几乎出现在每种语言当中：
        </p>
        <dl class="docutils">
         <dt>
          <em>
           输入（input）：
          </em>
         </dt>
         <dd>
          从键盘、文件、网络或者其他设备获取数据。
         </dd>
         <dt>
          <em>
           输出（output）：
          </em>
         </dt>
         <dd>
          在屏幕上显示数据，将数据保存至文件，通过网络传送数据，等等。
         </dd>
         <dt>
          <em>
           数学（math）：
          </em>
         </dt>
         <dd>
          执行基本的数学运算，如加法和乘法。
         </dd>
         <dt>
          <em>
           有条件执行（conditional execution）：
          </em>
         </dt>
         <dd>
          检查符合某个条件后，执行相应的代码。
         </dd>
         <dt>
          <em>
           重复（repetition）：
          </em>
         </dt>
         <dd>
          重复执行某个动作，通常会有一些变化。
         </dd>
        </dl>
        <p>
         无论你是否相信，这几乎是程序的全部指令了。每个你曾经用过的程序，无论多么复杂，都是由跟这些差不多的指令构成的。因此，你可以认为编程就是将庞大、复杂的任务分解为越来越小的子任务，直到这些子任务简单到可以用这其中的一个基本指令执行。
        </p>
       </div>
       <div class="section" id="python">
        <h2>
         运行Python
        </h2>
        <p>
         Python入门的一个障碍，是你可能需要在电脑上安装Python和相关软件。如果你熟悉电脑的操作系统，特别是如果你能熟练使用命令行（command-line interface），安装Python对你来说就不是问题了。但是对于初学者，同时学习系统管理（system administration）和编程这两方面的知识是件痛苦的事。
        </p>
        <p>
         为了避免这个问题，我建议你首先在浏览器中运行Python。等你对Python更加了解之后，我会建议你在电脑上安装Python。
        </p>
        <p>
         网络上有许多网页可以让你运行Python。如果你已经有最喜欢的网站，那就打开网页运行Python吧。如果没有，我推荐PythonAnywhere。我在
         <a class="reference external" href="http://tinyurl.com/thinkpython2e">
          http://tinyurl.com/thinkpython2e
         </a>
         给出了详细的使用指南。
        </p>
        <p>
         目前Python有两个版本，分别是Python 2和Python 3。二者十分相似，因此如果你学过某个版本，可以很容易地切换到另一个版本。事实上，作为初学者，你只会接触到很少数的不同之处。本书采用的是Python 3，但是我会加入一些关于Python 2的说明。
        </p>
        <p>
         Python的
         <strong>
          解释器
         </strong>
         是一个读取并执行Python代码的程序。根据你的电脑环境不同，你可以通过双击图标，或者在命令行输入
         <code class="docutils literal">
          <span class="pre">
           python
          </span>
         </code>
         的方式来启动解释器。解释器启动后，你应该看到类似下面的输出：
        </p>
        <div class="highlight-default">
         <div class="highlight">
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57685d4fe5a17871633849" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             &lt;span class="n"&gt;Python&lt;/span&gt; &lt;span class="mf"&gt;3.4&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Jun&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt; &lt;span class="mi"&gt;2015&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;GCC&lt;/span&gt; &lt;span class="mf"&gt;4.8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;linux&lt;/span&gt;
&lt;span class="n"&gt;Type&lt;/span&gt; &lt;span class="s2"&gt;"help"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"copyright"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"credits"&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="s2"&gt;"license"&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;more&lt;/span&gt; &lt;span class="n"&gt;information&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-57685d4fe5a17871633849-1">
                  1
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a17871633849-2">
                  2
                 </div>
                 <div class="crayon-num" data-line="crayon-57685d4fe5a17871633849-3">
                  3
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a17871633849-4">
                  4
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-57685d4fe5a17871633849-1">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "n"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   Python
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mf"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   3.4
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "o"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   .
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   0
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   (
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "n"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-st">
                   default
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   ,
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "n"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   Jun
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   19
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   2015
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   ,
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   14
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   :
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   20
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   :
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   21
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   )
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a17871633849-2">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   [
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "n"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   GCC
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mf"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   4.8
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "o"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   .
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   2
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   ]
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "n"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   on
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "n"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   linux
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line" id="crayon-57685d4fe5a17871633849-3">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "n"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   Type
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "s2"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-s">
                   "help"
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   ,
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "s2"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-s">
                   "copyright"
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   ,
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "s2"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-s">
                   "credits"
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "ow"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-st">
                   or
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "s2"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-s">
                   "license"
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "k"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-st">
                   for
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "n"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   more
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "n"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   information
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "o"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   .
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a17871633849-4">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "o"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0141 seconds] -->
         </div>
        </div>
        <p>
         前三行中包含了关于解释器及其运行的操作系统的信息，因此你看到的内容可能不一样。但是你应该检查下版本号是否以3开头，上面示例中的版本号是3.4.0。如果以3开头，那说明你正在运行Python 3。如果以2开头，那说明你正在运行（你猜对了）Python 2。
        </p>
        <p>
         最后一行是一个提示符（prompt），表明你可以在解释器中输入代码了。如果你输入一行代码然后按回车（Enter），解释器就会显示结果：
        </p>
        <div class="highlight-default">
         <div class="highlight">
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57685d4fe5a29921489071" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             &lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="go"&gt;2&lt;/span&gt;
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-57685d4fe5a29921489071-1">
                  1
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a29921489071-2">
                  2
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-57685d4fe5a29921489071-1">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   1
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "o"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   +
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   1
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a29921489071-2">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   2
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0029 seconds] -->
         </div>
        </div>
        <p>
         现在你已经做好了开始学习的准备。接下来，我将默认你已经知道如何启动Python解释器和执行代码。
        </p>
       </div>
       <div class="section" id="id3">
        <h2>
         第一个程序
        </h2>
        <p>
         根据传统，你用一门新语言写的第一个程序叫做“Hello, World!”，因为它的功能只不过是显示单词“Hello, World!”。在Python中，它看起来是这样：
        </p>
        <div class="highlight-default">
         <div class="highlight">
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57685d4fe5a30387192222" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             &lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Hello, World!'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-57685d4fe5a30387192222-1">
                  1
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-57685d4fe5a30387192222-1">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "nb"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   print
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   (
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "s1"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-s">
                   'Hello, World!'
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   )
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0024 seconds] -->
         </div>
        </div>
        <p>
         这是一个
         <code class="docutils literal">
          <span class="pre">
           print
          </span>
         </code>
         函数的示例，尽管它并不会真的在纸上打印。它将结果显示在屏幕上。在此例中，结果是单词：
        </p>
        <div class="highlight-default">
         <div class="highlight">
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57685d4fe5a36357798861" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             Hello, World!
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-57685d4fe5a36357798861-1">
                  1
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-57685d4fe5a36357798861-1">
                  <span class="crayon-v">
                   Hello
                  </span>
                  <span class="crayon-sy">
                   ,
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-v">
                   World
                  </span>
                  <span class="crayon-o">
                   !
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0005 seconds] -->
         </div>
        </div>
        <p>
         程序中的单引号标记了被打印文本的首尾；它们不会出现在结果中。
        </p>
        <p>
         括号说明
         <code class="docutils literal">
          <span class="pre">
           print
          </span>
         </code>
         是一个函数。我们将在第三章介绍函数。在Python 2中， print是一个语句；不是函数，所以不需要使用括号。
        </p>
        <div class="highlight-default">
         <div class="highlight">
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57685d4fe5a3d516274312" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             &lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s1"&gt;'Hello, World!'&lt;/span&gt;
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-57685d4fe5a3d516274312-1">
                  1
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-57685d4fe5a3d516274312-1">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "nb"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   print
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "s1"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-s">
                   'Hello, World!'
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0017 seconds] -->
         </div>
        </div>
        <p>
         很快你就会明白二者之间的区别，现在知道这些就足够了。
        </p>
        <blockquote>
         <div>
          译者注：Python核心开发者Brett Cannon详细解释了
          <a class="reference external" href="http://codingpy.com/article/why-print-became-a-function-in-python-3/">
           为什么print在Python 3中变成了函数
          </a>
          。
         </div>
        </blockquote>
       </div>
       <div class="section" id="id4">
        <h2>
         算术运算符
        </h2>
        <p>
         接下来介绍算术。Python提供了许多代表加法和乘法等运算的特殊符号，叫做
         <strong>
          运算符
         </strong>
         （operators）。
        </p>
        <p>
         运算符
         <code class="docutils literal">
          <span class="pre">
           +
          </span>
         </code>
         、
         <code class="docutils literal">
          <span class="pre">
           -
          </span>
         </code>
         和
         <code class="docutils literal">
          <span class="pre">
           *
          </span>
         </code>
         分别执行加法、减法和乘法，详见以下示例：
        </p>
        <div class="highlight-default">
         <div class="highlight">
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57685d4fe5a43353743477" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             &lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="go"&gt;42&lt;/span&gt;
&lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="mi"&gt;43&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="go"&gt;42&lt;/span&gt;
&lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;
&lt;span class="go"&gt;42&lt;/span&gt;
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-57685d4fe5a43353743477-1">
                  1
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a43353743477-2">
                  2
                 </div>
                 <div class="crayon-num" data-line="crayon-57685d4fe5a43353743477-3">
                  3
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a43353743477-4">
                  4
                 </div>
                 <div class="crayon-num" data-line="crayon-57685d4fe5a43353743477-5">
                  5
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a43353743477-6">
                  6
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-57685d4fe5a43353743477-1">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   40
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "o"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   +
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   2
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a43353743477-2">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   42
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line" id="crayon-57685d4fe5a43353743477-3">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   43
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "o"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   -
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   1
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a43353743477-4">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   42
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line" id="crayon-57685d4fe5a43353743477-5">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   6
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "o"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   *
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   7
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a43353743477-6">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   42
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0067 seconds] -->
         </div>
        </div>
        <p>
         运算符
         <code class="docutils literal">
          <span class="pre">
           /
          </span>
         </code>
         执行除法运算：
        </p>
        <div class="highlight-default">
         <div class="highlight">
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57685d4fe5a4a518049805" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             &lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="mi"&gt;84&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="go"&gt;42.0&lt;/span&gt;
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-57685d4fe5a4a518049805-1">
                  1
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a4a518049805-2">
                  2
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-57685d4fe5a4a518049805-1">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   84
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "o"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   2
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a4a518049805-2">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   42.0
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0024 seconds] -->
         </div>
        </div>
        <p>
         你可能会问，为什么结果是42.0，而不是42。在下节中，我会进行解释。
        </p>
        <p>
         最后，运算符
         <code class="docutils literal">
          <span class="pre">
           *
          </span>
         </code>
         执行乘方运算；也就是说，它将某个数字乘以自身相应的次数：
        </p>
        <div class="highlight-default">
         <div class="highlight">
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57685d4fe5a50125656284" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             &lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="go"&gt;42&lt;/span&gt;
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-57685d4fe5a50125656284-1">
                  1
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a50125656284-2">
                  2
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-57685d4fe5a50125656284-1">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   6
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "o"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   *
                  </span>
                  <span class="crayon-o">
                   *
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   2
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "o"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   +
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   6
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a50125656284-2">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   42
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0031 seconds] -->
         </div>
        </div>
        <p>
         某些语言使用
         <code class="docutils literal">
          <span class="pre">
           ^
          </span>
         </code>
         运算符执行乘方运算，但是在Python中，它却属于一种位运算符，叫做XOR。如果你对位运算符不太了解，那么下面的结果会让你感到惊讶：
        </p>
        <div class="highlight-default">
         <div class="highlight">
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57685d4fe5a56517203200" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             &lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="go"&gt;4&lt;/span&gt;
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-57685d4fe5a56517203200-1">
                  1
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a56517203200-2">
                  2
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-57685d4fe5a56517203200-1">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   6
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "o"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   ^
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   2
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a56517203200-2">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   4
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0025 seconds] -->
         </div>
        </div>
        <p>
         我不打算在本书中介绍位运算符，但是你可以阅读
         <a class="reference external" href="http://wiki.python.org/moin/BitwiseOperators">
          Python官方百科
         </a>
         ，了解相关内容。
        </p>
       </div>
       <div class="section" id="id6">
        <h2>
         值和类型
        </h2>
        <p>
         <strong>
          值（value）
         </strong>
         是程序处理的基本数据之一，比如说一个单词或一个数字。我们目前已经接触到的值有：2，42.0，和
         <code class="docutils literal">
          <span class="pre">
           'Hello
          </span>
          <span class="pre">
           World!'
          </span>
         </code>
         。
        </p>
        <p>
         这些值又属于不同的
         <strong>
          类型（types）
         </strong>
         ：2是一个
         <strong>
          整型数（integer）
         </strong>
         ，42.0 是一个
         <strong>
          浮点数（floating point number）
         </strong>
         ，而
         <code class="docutils literal">
          <span class="pre">
           'Hello,
          </span>
          <span class="pre">
           World!'
          </span>
         </code>
         则是一个
         <strong>
          字符串（string）
         </strong>
         ，之所以这么叫是因为其中的字符被串在了一起（strung together）。
        </p>
        <p>
         如果你不确定某个值的类型是什么，解释器可以告诉你：
        </p>
        <div class="highlight-default">
         <div class="highlight">
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57685d4fe5a5d419559713" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             &lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="go"&gt;&amp;lt;class 'int'&amp;gt;&lt;/span&gt;
&lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;42.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="go"&gt;&amp;lt;class 'float'&amp;gt;&lt;/span&gt;
&lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Hello, World!'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="go"&gt;&amp;lt;class 'str'&amp;gt;&lt;/span&gt;
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-57685d4fe5a5d419559713-1">
                  1
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a5d419559713-2">
                  2
                 </div>
                 <div class="crayon-num" data-line="crayon-57685d4fe5a5d419559713-3">
                  3
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a5d419559713-4">
                  4
                 </div>
                 <div class="crayon-num" data-line="crayon-57685d4fe5a5d419559713-5">
                  5
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a5d419559713-6">
                  6
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-57685d4fe5a5d419559713-1">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "nb"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   type
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   (
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   2
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   )
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a5d419559713-2">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   lt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-s">
                   'int'
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line" id="crayon-57685d4fe5a5d419559713-3">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "nb"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   type
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   (
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mf"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   42.0
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   )
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a5d419559713-4">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   lt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-s">
                   'float'
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line" id="crayon-57685d4fe5a5d419559713-5">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "nb"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   type
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   (
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "s1"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-s">
                   'Hello, World!'
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   )
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a5d419559713-6">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   lt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-s">
                   'str'
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0083 seconds] -->
         </div>
        </div>
        <p>
         “class”一词在上面的输出结果中，是类别的意思；一个类型就是一个类别的值。
        </p>
        <p>
         不出意料，整型数属于
         <code class="docutils literal">
          <span class="pre">
           int
          </span>
         </code>
         类型，字符串属于
         <code class="docutils literal">
          <span class="pre">
           str
          </span>
         </code>
         类型，浮点数属于
         <code class="docutils literal">
          <span class="pre">
           float
          </span>
         </code>
         类型。
        </p>
        <p>
         那么像
         <code class="docutils literal">
          <span class="pre">
           '2'
          </span>
         </code>
         和
         <code class="docutils literal">
          <span class="pre">
           '42.0'
          </span>
         </code>
         这样的值呢？它们看上去像数字，但是又和字符串一样被引号括在了一起？
        </p>
        <div class="highlight-default">
         <div class="highlight">
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57685d4fe5a64687319376" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             &lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'2'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="go"&gt;&amp;lt;class 'str'&amp;gt;&lt;/span&gt;
&lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'42.0'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="go"&gt;&amp;lt;class 'str'&amp;gt;&lt;/span&gt;
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-57685d4fe5a64687319376-1">
                  1
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a64687319376-2">
                  2
                 </div>
                 <div class="crayon-num" data-line="crayon-57685d4fe5a64687319376-3">
                  3
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a64687319376-4">
                  4
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-57685d4fe5a64687319376-1">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "nb"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   type
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   (
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "s1"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-s">
                   '2'
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   )
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a64687319376-2">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   lt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-s">
                   'str'
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line" id="crayon-57685d4fe5a64687319376-3">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "nb"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-v">
                   type
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   (
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "s1"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-s">
                   '42.0'
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   )
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a64687319376-4">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   lt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-s">
                   'str'
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0056 seconds] -->
         </div>
        </div>
        <p>
         它们其实是字符串。
        </p>
        <p>
         当你输入一个大数值的整型数时，你可能会想用逗号进行区分，比如说像这样：1,000,000。在Python中，这不是一个合法的
         <em>
          整型数
         </em>
         ，但却是合法的值。
        </p>
        <div class="highlight-default">
         <div class="highlight">
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57685d4fe5a6a038369991" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             &lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;000&lt;/span&gt;
&lt;span class="go"&gt;(1, 0, 0)&lt;/span&gt;
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-57685d4fe5a6a038369991-1">
                  1
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-57685d4fe5a6a038369991-2">
                  2
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-57685d4fe5a6a038369991-1">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "gp"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-o">
                   &amp;
                  </span>
                  <span class="crayon-v">
                   gt
                  </span>
                  <span class="crayon-sy">
                   ;
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   1
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   ,
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   000
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "p"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   ,
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "mi"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-cn">
                   000
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-57685d4fe5a6a038369991-2">
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-e">
                   span
                  </span>
                  <span class="crayon-t">
                   class
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-s">
                   "go"
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                  <span class="crayon-sy">
                   (
                  </span>
                  <span class="crayon-cn">
                   1
                  </span>
                  <span class="crayon-sy">
                   ,
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-cn">
                   0
                  </span>
                  <span class="crayon-sy">
                   ,
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-cn">
                   0
                  </span>
                  <span class="crayon-sy">
                   )
                  </span>
                  <span class="crayon-o">
                   &lt;
                  </span>
                  <span class="crayon-o">
                   /
                  </span>
                  <span class="crayon-v">
                   span
                  </span>
                  <span class="crayon-o">
                   &gt;
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0034 seconds] -->
         </div>
        </div>
        <p>
         结果和我们预料的完全不同！Python把1,000,000当作成了一个以逗号区分的整型数序列。在后面的章节中，我们会介绍更多有关这种序列的知识。
        </p>
       </div>
       <div class="section" id="id7">
        <h2>
         形式语言和自然语言
        </h2>
        <p>
         <strong>
          自然语言（natural language）
         </strong>
         是人们交流所使用的语言，例如英语、西班牙语和法语。它们不是人为设计出来的（尽管有人试图这样做）；而是自然演变而来。
        </p>
        <p>
         <strong>
          形式语言（formal languages）
         </strong>
         是人类为了特殊用途而设计出来的。例如，数学家使用的记号（notation）就是形式语言，特别擅长表示数字和符号之间的关系。化学家使用形式语言表示分子的化学结构。 最重要的是：
        </p>
        <blockquote>
         <div>
          <strong>
           编程语言是被设计用于表达计算的形式语言。
          </strong>
         </div>
        </blockquote>
        <p>
         形式语言通常拥有严格的
         <strong>
          语法
         </strong>
         规则，规定了详细的语句结构。例如，
         <span class="math">
          <span class="MathJax" data-mathml='&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;/math&gt;' id="MathJax-Element-1-Frame" style="box-sizing: border-box; display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;" tabindex="0">
           <span class="math" id="MathJax-Span-1">
            <span class="mrow" id="MathJax-Span-2">
             <span class="mn" id="MathJax-Span-3">
              3
             </span>
             <span class="mo" id="MathJax-Span-4">
              +
             </span>
             <span class="mn" id="MathJax-Span-5">
              3
             </span>
             <span class="mo" id="MathJax-Span-6">
              =
             </span>
             <span class="mn" id="MathJax-Span-7">
              6
             </span>
            </span>
           </span>
           <span class="MJX_Assistive_MathML">
            3+3=6
           </span>
          </span>
         </span>
         是语法正确的数学表达式，而
         <span class="math">
          <span class="MathJax" data-mathml='&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mi mathvariant="normal"&gt;&amp;#x0024;&lt;/mi&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;/math&gt;' id="MathJax-Element-2-Frame" style="box-sizing: border-box; display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;" tabindex="0">
           <span class="math" id="MathJax-Span-8">
            <span class="mrow" id="MathJax-Span-9">
             <span class="mn" id="MathJax-Span-10">
              3
             </span>
             <span class="mo" id="MathJax-Span-11">
              +
             </span>
             <span class="mo" id="MathJax-Span-12">
              =
             </span>
             <span class="mn" id="MathJax-Span-13">
              3
             </span>
             <span class="mi" id="MathJax-Span-14">
              $
             </span>
             <span class="mn" id="MathJax-Span-15">
              6
             </span>
            </span>
           </span>
           <span class="MJX_Assistive_MathML">
            3+=3$6
           </span>
          </span>
         </span>
         则不是；
         <span class="math">
          <span class="MathJax" data-mathml='&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;msub&gt;&lt;mi&gt;H&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;/math&gt;' id="MathJax-Element-3-Frame" style="box-sizing: border-box; display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;" tabindex="0">
           <span class="math" id="MathJax-Span-16">
            <span class="mrow" id="MathJax-Span-17">
             <span class="msubsup" id="MathJax-Span-18">
              <span class="mi" id="MathJax-Span-19">
               H
              </span>
              <span class="mn" id="MathJax-Span-20">
               2
              </span>
             </span>
             <span class="mi" id="MathJax-Span-21">
              O
             </span>
            </span>
           </span>
           <span class="MJX_Assistive_MathML">
            H2O
           </span>
          </span>
         </span>
         是语法正确的化学式，而
         <span class="math">
          <span class="MathJax" data-mathml='&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;msub&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;Z&lt;/mi&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;/math&gt;' id="MathJax-Element-4-Frame" style="box-sizing: border-box; display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;" tabindex="0">
           <span class="math" id="MathJax-Span-22">
            <span class="mrow" id="MathJax-Span-23">
             <span class="msubsup" id="MathJax-Span-24">
              <span class="mi" id="MathJax-Span-25">
              </span>
              <span class="mn" id="MathJax-Span-26">
               2
              </span>
             </span>
             <span class="mi" id="MathJax-Span-27">
              Z
             </span>
             <span class="mi" id="MathJax-Span-28">
              z
             </span>
            </span>
           </span>
           <span class="MJX_Assistive_MathML">
            2Zz
           </span>
          </span>
         </span>
         则不是。
        </p>
        <p>
         语法规则有两种类型，分别涉及
         <strong>
          记号（tokens）
         </strong>
         和结构。记号是语言的基本元素，例如单词、数字和化学元素。
         <span class="math">
          <span class="MathJax" data-mathml='&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mi mathvariant="normal"&gt;&amp;#x0024;&lt;/mi&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;/math&gt;' id="MathJax-Element-5-Frame" style="box-sizing: border-box; display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;" tabindex="0">
           <span class="math" id="MathJax-Span-29">
            <span class="mrow" id="MathJax-Span-30">
             <span class="mn" id="MathJax-Span-31">
              3
             </span>
             <span class="mo" id="MathJax-Span-32">
              +
             </span>
             <span class="mo" id="MathJax-Span-33">
              =
             </span>
             <span class="mn" id="MathJax-Span-34">
              3
             </span>
             <span class="mi" id="MathJax-Span-35">
              $
             </span>
             <span class="mn" id="MathJax-Span-36">
              6
             </span>
            </span>
           </span>
           <span class="MJX_Assistive_MathML">
            3+=3$6
           </span>
          </span>
         </span>
         这个式子的问题之一，就是 $ 在数学中不是一个合法的记号 （至少据我所知）。类似的，
         <span class="math">
          <span class="MathJax" data-mathml='&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;msub&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;Z&lt;/mi&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;/math&gt;' id="MathJax-Element-6-Frame" style="box-sizing: border-box; display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;" tabindex="0">
           <span class="math" id="MathJax-Span-37">
            <span class="mrow" id="MathJax-Span-38">
             <span class="msubsup" id="MathJax-Span-39">
              <span class="mi" id="MathJax-Span-40">
              </span>
              <span class="mn" id="MathJax-Span-41">
               2
              </span>
             </span>
             <span class="mi" id="MathJax-Span-42">
              Z
             </span>
             <span class="mi" id="MathJax-Span-43">
              z
             </span>
            </span>
           </span>
           <span class="MJX_Assistive_MathML">
            2Zz
           </span>
          </span>
         </span>
         也不合法，因为没有一个元素的简写是
         <span class="math">
          <span class="MathJax" data-mathml='&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;mi&gt;Z&lt;/mi&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;/math&gt;' id="MathJax-Element-7-Frame" style="box-sizing: border-box; display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;" tabindex="0">
           <span class="math" id="MathJax-Span-44">
            <span class="mrow" id="MathJax-Span-45">
             <span class="mi" id="MathJax-Span-46">
              Z
             </span>
             <span class="mi" id="MathJax-Span-47">
              z
             </span>
            </span>
           </span>
           <span class="MJX_Assistive_MathML">
            Zz
           </span>
          </span>
         </span>
         。
        </p>
        <p>
         第二种语法规则与标记的组合方式有关。
         <span class="math">
          <span class="MathJax" data-mathml='&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/math&gt;' id="MathJax-Element-8-Frame" style="box-sizing: border-box; display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;" tabindex="0">
           <span class="math" id="MathJax-Span-48">
            <span class="mrow" id="MathJax-Span-49">
             <span class="mn" id="MathJax-Span-50">
              3
             </span>
             <span class="mo" id="MathJax-Span-51">
              +
             </span>
             <span class="mo" id="MathJax-Span-52">
              =
             </span>
             <span class="mn" id="MathJax-Span-53">
              3
             </span>
            </span>
           </span>
           <span class="MJX_Assistive_MathML">
            3+=3
           </span>
          </span>
         </span>
         这个方程是非法的，因为即使
         <span class="math">
          <span class="MathJax" data-mathml='&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;/math&gt;' id="MathJax-Element-9-Frame" style="box-sizing: border-box; display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;" tabindex="0">
           <span class="math" id="MathJax-Span-54">
            <span class="mrow" id="MathJax-Span-55">
             <span class="mo" id="MathJax-Span-56">
              +
             </span>
            </span>
           </span>
           <span class="MJX_Assistive_MathML">
            +
           </span>
          </span>
         </span>
         和
         <span class="math">
          <span class="MathJax" data-mathml='&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;/math&gt;' id="MathJax-Element-10-Frame" style="box-sizing: border-box; display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;" tabindex="0">
           <span class="math" id="MathJax-Span-57">
            <span class="mrow" id="MathJax-Span-58">
             <span class="mo" id="MathJax-Span-59">
              =
             </span>
            </span>
           </span>
           <span class="MJX_Assistive_MathML">
            =
           </span>
          </span>
         </span>
         都是合法的记号，但是你却不能把它们俩紧挨在一起。类似的，在化学式中，下标位于元素之后，而不是之前。
        </p>
        <p>
         This is @ well-structured Engli$h sentence with invalid t*kens in it. This sentence all valid tokens has, but invalid structure with.
        </p>
        <blockquote>
         <div>
          译者注：上面两句英文都是不符合语法的，一个包含非法标记，另一个结构不符合语法。
         </div>
        </blockquote>
        <p>
         当你读一个用英语写的句子或者用形式语言写的语句时，你都必须要理清各自的结构（尽管在阅读自然语言时，你是下意识地进行的）。这个过程被称为
         <strong>
          解析（parsing）
         </strong>
         。
        </p>
        <p>
         虽然形式语言和自然语言有很多共同点——标记、结构和语法，它们也有一些不同：
        </p>
        <dl class="docutils">
         <dt>
          <em>
           歧义性
          </em>
          ：
         </dt>
         <dd>
          自然语言充满歧义，人们使用上下文线索以及其它信息处理这些歧义。形式语言被设计成几乎或者完全没有歧义，这意味着不管上下文是什么，任何语句都只有一个意义。
         </dd>
         <dt>
          <em>
           冗余性
          </em>
          ：
         </dt>
         <dd>
          为了弥补歧义性并减少误解，自然语言使用很多冗余。结果，自然语言经常很冗长。形式语言则冗余较少，更简洁。
         </dd>
         <dt>
          <em>
           字面性
          </em>
          ：
         </dt>
         <dd>
          自然语言充满成语和隐喻。如果我说“The penny dropped”，可能根本没有便士、也没什么东西掉下来（这个成语的意思是，经过一段时间的困惑后终于理解某事）。形式语言的含义，与它们字面的意思完全一致。
         </dd>
        </dl>
        <p>
         由于我们都是说着自然语言长大的，我们有时候很难适应形式语言。形式语言与自然语言之间的不同，类似诗歌与散文之间的差异，而且更加明显：
        </p>
        <dl class="docutils">
         <dt>
          <em>
           诗歌
          </em>
          ：
         </dt>
         <dd>
          单词的含义和声音都有作用， 整首诗作为一个整理，会对人产生影响，或是引发情感上的共鸣。 歧义不但常见，而且经常是故意为之。
         </dd>
         <dt>
          <em>
           散文
          </em>
          ：
         </dt>
         <dd>
          单词表面的含义更重要，句子结构背后的寓意更深。 散文比诗歌更适合分析，但仍然经常有歧义。
         </dd>
         <dt>
          <em>
           程序
          </em>
          ：
         </dt>
         <dd>
          计算机程序的含义是无歧义、无引申义的， 通过分析程序的标记和结构，即可完全理解。
         </dd>
        </dl>
        <p>
         形式语言要比自然语言更加稠密，因此阅读起来花的时间会更长。另外，形式语言的结构也很重要，所以从上往下、从左往右阅读，并不总是最好的策略。相反，你得学会在脑海里分析一个程序，识别不同的标记并理解其结构。最后，注重细节。拼写和标点方面的小错误在自然语言中无伤大雅，但是在形式语言中却会产生很大的影响。
        </p>
       </div>
       <div class="section" id="id8">
        <h2>
         调试
        </h2>
        <p>
         程序员都会犯错。由于比较奇怪的原因，编程错误被称为
         <strong>
          故障（译者注：英文为bug，一般指虫子）
         </strong>
         ，追踪错误的过程被称为
         <strong>
          调试（debugging）
         </strong>
         。
        </p>
        <p>
         编程，尤其是调试，有时会让人动情绪。如果你有个很难的bug解决不了，你可能会感到愤怒、忧郁抑或是丢人。
        </p>
        <p>
         有证据表明，人们很自然地把计算机当人来对待。当计算机表现好的时候，我们认为它们是队友，而当它们固执或无礼的时候，我们也会像对待固执或无礼人的一样对待它们（Reeves and Nass,
         <em>
          The Media Equation: How People Treat Computers, Television, and New Media Like Real People and Places
         </em>
         ）。
        </p>
        <p>
         对这些反应做好准备有助于你对付它们。 一种方法是将计算机看做是一个雇员，拥有特定的长处， 例如速度和精度，也有些特别的缺点，像缺乏沟通以及不善于把握大局。
        </p>
        <p>
         你的工作是当一个好的管理者：找到充分利用优点、摒弃弱点的方法。 并且找到使用你的情感来解决问题的方法， 而不是让你的情绪干扰你有效工作的能力。
        </p>
        <p>
         学习调试可能很令人泄气， 但是它对于许多编程之外的活动也是一个非常有价值的技能。 在每一章的结尾，我都会花一节内容介绍一些调试建议，比如说这一节。希望能帮到你！
        </p>
       </div>
       <div class="section" id="id9">
        <h2>
         术语表
        </h2>
        <dl class="docutils">
         <dt>
          <em>
           解决问题
          </em>
          ：
         </dt>
         <dd>
          将问题形式化、寻找并表达解决方案的过程。
         </dd>
         <dt>
          <em>
           高级语言（high-level language）
          </em>
          ：
         </dt>
         <dd>
          像Python这样被设计成人类容易阅读和编写的编程语言。
         </dd>
         <dt>
          <em>
           低级语言(low-level language)
          </em>
          ：
         </dt>
         <dd>
          被设计成计算机容易运行的编程语言；也被称为“机器语言”或“汇编语言（assembly language）”。
         </dd>
         <dt>
          <em>
           可移植性
          </em>
          ：
         </dt>
         <dd>
          程序能够在多种计算机上运行的特性。
         </dd>
         <dt>
          <em>
           解释器
          </em>
          ：
         </dt>
         <dd>
          读取另一个程序并执行该程序的程序。
         </dd>
         <dt>
          <em>
           提示符
          </em>
          ：
         </dt>
         <dd>
          解释器所显示的字符，表明已准备好接受用户的输入。
         </dd>
         <dt>
          <em>
           程序
          </em>
          ：
         </dt>
         <dd>
          说明一个计算的一组指令。
         </dd>
         <dt>
          <em>
           打印语句
          </em>
          ：
         </dt>
         <dd>
          使Python解释器在屏幕上显示某个值的指令。
         </dd>
         <dt>
          <em>
           运算符
          </em>
          ：
         </dt>
         <dd>
          代表类似加法、乘法或者字符串连接（string concatenation）等简单计算的特殊符号。
         </dd>
         <dt>
          <em>
           值
          </em>
          ：
         </dt>
         <dd>
          程序所处理数据的基本元素之一，例如数字或字符串。
         </dd>
         <dt>
          <em>
           类型
          </em>
          ：
         </dt>
         <dd>
          值的类别。我们目前接触的类型有整型数（类型为
          <code class="docutils literal">
           <span class="pre">
            int
           </span>
          </code>
          ）、浮点数（类型为
          <code class="docutils literal">
           <span class="pre">
            float
           </span>
          </code>
          ）和字符串（类型为
          <code class="docutils literal">
           <span class="pre">
            str
           </span>
          </code>
          ）
         </dd>
         <dt>
          <em>
           整型数
          </em>
          ：
         </dt>
         <dd>
          代表整数的类型。
         </dd>
         <dt>
          <em>
           浮点数
          </em>
          ：
         </dt>
         <dd>
          代表一个有小数点的数字的类型。
         </dd>
         <dt>
          <em>
           字符串
          </em>
          ：
         </dt>
         <dd>
          代表一系列字符的类型。
         </dd>
         <dt>
          <em>
           自然语言
          </em>
          ：
         </dt>
         <dd>
          任意一种人们日常使用的、自然演变而来的语言。
         </dd>
         <dt>
          <em>
           形式语言
          </em>
          ：
         </dt>
         <dd>
          任意一种人类为了某种目的而设计的语言，例如用来表示数学概念或者电脑程序；所有的编程语言都是形式语言。
         </dd>
         <dt>
          <em>
           记号
          </em>
          ：
         </dt>
         <dd>
          程序语法结构中的基本元素之一，与自然语言中的单词类似。
         </dd>
         <dt>
          <em>
           语法
          </em>
          ：
         </dt>
         <dd>
          规定了程序结构的规则。
         </dd>
         <dt>
          <em>
           解析
          </em>
          ：
         </dt>
         <dd>
          阅读程序，并分析其语法结构的过程
         </dd>
         <dt>
          <em>
           故障
          </em>
          ：
         </dt>
         <dd>
          程序中的错误。
         </dd>
         <dt>
          <em>
           调试
          </em>
          ：
         </dt>
         <dd>
          寻找并解决错误的过程。
         </dd>
        </dl>
       </div>
       <div class="section" id="id10">
        <h2>
         练习题
        </h2>
        <div class="section" id="id11">
         <h3>
          习题 1-1
         </h3>
         <p>
          你最好在电脑前阅读此书，因为你可以随时测试书中的示例。
         </p>
         <p>
          每当你试验一个新特性的时候，你应该试着去犯错。举个例子，在“Hello, World!”程序中，如果你漏掉一个引号会发生什么情况？如果你去掉两个引号呢？如果你把print写错了呢？
         </p>
         <p>
          这类试验能帮助你记忆读过的内容；对你平时编程也有帮助，因为你可以了解不同的错误信息代表的意思。现在故意犯错误，总胜过以后不小心犯错。
         </p>
         <ol class="arabic simple">
          <li>
           在打印语句中，如果你去掉一个或两个括号，会发生什么？
          </li>
          <li>
           你想打印一个字符串，如果你去掉一个或两个引号，会发生什么？
          </li>
          <li>
           你可以使用减号创建一个负数，如-2。如果你在一个数字前再加上个加号，会发生什么？2++2会得出什么结果？
          </li>
          <li>
           在数学标记中，前导零（leading zeros）没有问题，如02。如果我们在Python中这样做，会发生什么？
          </li>
          <li>
           如果两个值之间没有运算符，又会发生什么？
          </li>
         </ol>
        </div>
        <div class="section" id="id12">
         <h3>
          习题 1-2
         </h3>
         <p>
          启动Python解释器，把它当计算器使用。
         </p>
         <ol class="arabic">
          <li>
           <p class="first">
            42分42秒一共有多少秒？
           </p>
          </li>
          <li>
           <p class="first">
            10公里可以换算成多少英里？提示：一英里等于1.61公里。
           </p>
          </li>
          <li>
           <p class="first">
            如果你花42分42秒跑完了10公里，你的平均配速（pace）是多少（每英里耗时，分别精确到分和秒）？你每小时平均跑了多少英里（英里/时）？
           </p>
           <blockquote>
            <div>
             <p>
              译者注：配速（pace）是在马拉松运动的训练中常使用的一个概念，配速是速度的一种，是每公里所需要的时间。配速=时间/距离。
             </p>
            </div>
           </blockquote>
          </li>
         </ol>
         <p>
          <strong>
           贡献者
          </strong>
         </p>
         <ol class="arabic simple">
          <li>
           翻译：
           <a class="reference external" href="https://github.com/bingjin">
            @bingjin
           </a>
          </li>
          <li>
           校对：
           <a class="reference external" href="https://github.com/bingjin">
            @bingjin
           </a>
          </li>
          <li>
           参考：
           <a class="reference external" href="https://github.com/carfly">
            @carfly
           </a>
          </li>
         </ol>
        </div>
       </div>
       <p>
       </p>
       <p>
        来源：编程派   原文链接：http://codingpy.com/books/thinkpython2/01-the-way-of-the-program.html
       </p>
      </div>
      <div>
       <strong>
        注：转载文章均来自于公开网络，仅供学习使用，不会用于任何商业用途，如果侵犯到原作者的权益，请您与我们联系删除或者授权事宜，联系邮箱：contact@dataunion.org。转载数盟网站文章请注明原文章作者，否则产生的任何版权纠纷与数盟无关。
       </strong>
      </div>
      <!--content_text-->
      <div class="fenxian">
       <!-- JiaThis Button BEGIN -->
       <div class="jiathis_style_32x32">
        <p class="jiathis_button_weixin">
        </p>
        <p class="jiathis_button_tsina">
        </p>
        <p class="jiathis_button_qzone">
        </p>
        <p class="jiathis_button_cqq">
        </p>
        <p class="jiathis_button_tumblr">
        </p>
        <a class="jiathis jiathis_txt jtico jtico_jiathis" href="http://www.jiathis.com/share" target="_blank">
        </a>
        <p class="jiathis_counter_style">
        </p>
       </div>
       <!-- JiaThis Button END -->
      </div>
     </article>
     <!--content-->
     <!--相关文章-->
     <div class="xianguan">
      <div class="xianguantitle">
       相关文章！
      </div>
      <ul class="pic">
       <li>
        <a href="http://dataunion.org/24121.html">
         <img src="http://dataunion.org/wp-content/uploads/2016/05/220309riuno6638iqoua8u-152x200.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/24121.html" rel="bookmark" title="程序员必读的书，StackOverflow 创始人推荐">
         程序员必读的书，StackOverflow 创始人推荐
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/24051.html">
         <img src="http://dataunion.org/wp-content/uploads/2016/05/1605051412271910-152x200.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/24051.html" rel="bookmark" title="关于数据科学的十本好书（英文篇）">
         关于数据科学的十本好书（英文篇）
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/23995.html">
         <img src="http://dataunion.org/wp-content/uploads/2016/05/1462247200170022837-200x200.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/23995.html" rel="bookmark" title="编程书单：十本Python编程语言的入门书籍">
         编程书单：十本Python编程语言的入门书籍
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/23944.html">
         <img src="http://dataunion.org/wp-content/uploads/2016/05/QQ截图20160504092709-300x187.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/23944.html" rel="bookmark" title="【推荐几本好书】Java程序员必读之热门书单">
         【推荐几本好书】Java程序员必读之热门书单
        </a>
       </li>
      </ul>
     </div>
     <!--相关文章-->
     <div class="comment" id="comments">
      <!-- You can start editing here. -->
      <!-- If comments are open, but there are no comments. -->
      <div class="title">
       期待你一针见血的评论，Come on！
      </div>
      <div id="respond">
       <p>
        不用想啦，马上
        <a href="http://dataunion.org/wp-login.php?redirect_to=http%3A%2F%2Fdataunion.org%2F24684.html">
         "登录"
        </a>
        发表自已的想法.
       </p>
      </div>
     </div>
     <!-- .nav-single -->
    </div>
    <!--Container End-->
    <aside id="sitebar">
     <div class="sitebar_list2">
      <div class="wptag">
       <span class="tagtitle">
        热门标签+
       </span>
       <div class="tagg">
        <ul class="menu" id="menu-%e5%8f%8b%e6%83%85%e9%93%be%e6%8e%a5">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-1605" id="menu-item-1605">
          <a href="http://taidizh.com/">
           泰迪智慧
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-20884" id="menu-item-20884">
          <a href="http://www.transwarp.cn/">
           星环科技
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-3538" id="menu-item-3538">
          <a href="http://datall.org/">
           珈和遥感
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-20888" id="menu-item-20888">
          <a href="http://www.chinahadoop.cn/">
           小象学院
          </a>
         </li>
        </ul>
       </div>
      </div>
     </div>
     <div class="sitebar_list">
      <div class="textwidget">
       <div align="center">
        <a href="http://study.163.com/course/courseMain.htm?courseId=991022" target="_blank">
         <img src="http://dataunion.org/wp-content/uploads/2016/03/dv.jpg"/>
        </a>
       </div>
      </div>
     </div>
     <div class="sitebar_list">
      <h4 class="sitebar_title">
       文章分类
      </h4>
      <div class="tagcloud">
       <a class="tag-link-44" href="http://dataunion.org/category/industry/demo" style="font-size: 10.204724409449pt;" title="4个话题">
        Demo展示
       </a>
       <a class="tag-link-31" href="http://dataunion.org/category/experts" style="font-size: 15.826771653543pt;" title="52个话题">
        专家团队
       </a>
       <a class="tag-link-870" href="http://dataunion.org/category/tech/ai" style="font-size: 19.795275590551pt;" title="273个话题">
        人工智能
       </a>
       <a class="tag-link-488" href="http://dataunion.org/category/%e5%8a%a0%e5%85%a5%e6%95%b0%e7%9b%9f" style="font-size: 8pt;" title="1个话题">
        加入数盟
       </a>
       <a class="tag-link-869" href="http://dataunion.org/category/tech/viz" style="font-size: 17.204724409449pt;" title="93个话题">
        可视化
       </a>
       <a class="tag-link-30" href="http://dataunion.org/category/partners" style="font-size: 10.645669291339pt;" title="5个话题">
        合作伙伴
       </a>
       <a class="tag-link-889" href="http://dataunion.org/category/parterc" style="font-size: 11.582677165354pt;" title="8个话题">
        合作会议
       </a>
       <a class="tag-link-104" href="http://dataunion.org/category/books" style="font-size: 12.96062992126pt;" title="15个话题">
        图书
       </a>
       <a class="tag-link-220" href="http://dataunion.org/category/tech/base" style="font-size: 19.850393700787pt;" title="281个话题">
        基础架构
       </a>
       <a class="tag-link-219" href="http://dataunion.org/category/tech/analysis" style="font-size: 19.409448818898pt;" title="232个话题">
        数据分析
       </a>
       <a class="tag-link-887" href="http://dataunion.org/category/tech/dm" style="font-size: 13.291338582677pt;" title="17个话题">
        数据挖掘
       </a>
       <a class="tag-link-34" href="http://dataunion.org/category/tech" style="font-size: 20.732283464567pt;" title="404个话题">
        文章
       </a>
       <a class="tag-link-1" href="http://dataunion.org/category/uncategorized" style="font-size: 22pt;" title="693个话题">
        未分类
       </a>
       <a class="tag-link-4" href="http://dataunion.org/category/events" style="font-size: 14.503937007874pt;" title="29个话题">
        活动
       </a>
       <a class="tag-link-890" href="http://dataunion.org/category/tech/%e6%b7%b1%e5%ba%a6%e5%ad%a6%e4%b9%a0" style="font-size: 10.204724409449pt;" title="4个话题">
        深度学习
       </a>
       <a class="tag-link-221" href="http://dataunion.org/category/tech/devl" style="font-size: 18.968503937008pt;" title="193个话题">
        编程语言
       </a>
       <a class="tag-link-888" href="http://dataunion.org/category/career" style="font-size: 15.661417322835pt;" title="48个话题">
        职业规划
       </a>
       <a class="tag-link-5" href="http://dataunion.org/category/jobs" style="font-size: 14.11811023622pt;" title="25个话题">
        职位
       </a>
       <a class="tag-link-871" href="http://dataunion.org/category/industry" style="font-size: 15.716535433071pt;" title="49个话题">
        行业
       </a>
       <a class="tag-link-613" href="http://dataunion.org/category/industry/case" style="font-size: 16.984251968504pt;" title="84个话题">
        行业应用
       </a>
       <a class="tag-link-885" href="http://dataunion.org/category/industry/news" style="font-size: 17.425196850394pt;" title="102个话题">
        行业资讯
       </a>
       <a class="tag-link-10" href="http://dataunion.org/category/training" style="font-size: 14.228346456693pt;" title="26个话题">
        课程
       </a>
       <a class="tag-link-16" href="http://dataunion.org/category/sources" style="font-size: 15.661417322835pt;" title="48个话题">
        资源
       </a>
      </div>
     </div>
     <div class="sitebar_list">
      <h4 class="sitebar_title">
       功能
      </h4>
      <ul>
       <li>
        <a href="http://dataunion.org/wp-login.php?action=register">
         注册
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/wp-login.php">
         登录
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/feed">
         文章
         <abbr title="Really Simple Syndication">
          RSS
         </abbr>
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/comments/feed">
         评论
         <abbr title="Really Simple Syndication">
          RSS
         </abbr>
        </a>
       </li>
       <li>
        <a href="https://cn.wordpress.org/" title="基于WordPress，一个优美、先进的个人信息发布平台。">
         WordPress.org
        </a>
       </li>
      </ul>
     </div>
    </aside>
    <div class="clear">
    </div>
   </div>
   <!--main-->
   ﻿
   <footer id="dibu">
    <div class="about">
     <div class="right">
      <ul class="menu" id="menu-%e5%ba%95%e9%83%a8%e8%8f%9c%e5%8d%95">
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-18024" id="menu-item-18024">
        <a href="http://dataunion.org/category/partners">
         合作伙伴
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20881" id="menu-item-20881">
        <a href="http://dataunion.org/contribute">
         文章投稿
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20872" id="menu-item-20872">
        <a href="http://dataunion.org/category/%e5%8a%a0%e5%85%a5%e6%95%b0%e7%9b%9f">
         加入数盟
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22441" id="menu-item-22441">
        <a href="http://dataunion.org/f-links">
         友情链接
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20874" id="menu-item-20874">
        <a href="http://dataunion.org/aboutus">
         关于数盟
        </a>
       </li>
      </ul>
      <p class="banquan">
       数盟社区        ，
        做最棒的数据科学社区
      </p>
     </div>
     <div class="left">
      <ul class="bottomlist">
       <li>
        <a href="http://weibo.com/DataScientistUnion  " target="_blank" 　title="">
         <img src="http://dataunion.org/wp-content/themes/yzipi/images/weibo.png"/>
        </a>
       </li>
       <li>
        <a class="cd-popup-trigger" href="http://dataunion.org/24684.html#0">
         <img src="http://dataunion.org/wp-content/themes/yzipi/images/weixin.png"/>
        </a>
       </li>
      </ul>
      <div class="cd-popup">
       <div class="cd-popup-container">
        <h1>
         扫描二维码,加微信公众号
        </h1>
        <img src="http://dataunion.org/wp-content/themes/yzipi/images/2014-12-06-1515289049.png"/>
        <a class="cd-popup-close" href="http://dataunion.org/24684.html">
        </a>
       </div>
       <!-- cd-popup-container -->
      </div>
      <!-- cd-popup -->
     </div>
    </div>
    <!--about-->
    <div class="bottom">
     <a href="http://dataunion.org/">
      数盟社区
     </a>
     <a href="http://www.miitbeian.gov.cn/" rel="external nofollow" target="_blank">
      京ICP备14026740号
     </a>
     联系我们：
     <a href="mailto:contact@dataunion.org" target="_blank">
      contact@dataunion.org
     </a>
     <div class="tongji">
     </div>
     <!--bottom-->
     <div class="scroll" id="scroll" style="display:none;">
      ︿
     </div>
    </div>
   </footer>
   <!--dibu-->
  </div>
 </body>
</html>